package com.shzq.controller;

import com.shzq.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    @RequestMapping("/depth/{year}")
    public Map<String,List> countByYearAndDepth(@PathVariable("year") String year){
        return reportService.countByYearAndDepth(year);
    }
    @RequestMapping("/quarter_depth/{month_begin}/{month_end}")
    public Map<String,List> countByQuarterAndDepth(@PathVariable("month_begin") String m_begin,@PathVariable("month_end") String m_end){
        return reportService.countByQuarterAndDepth(m_begin,m_end);
    }
    @RequestMapping("/quarter_strength/{month_begin}/{month_end}")
    public Map<String,List> countByQuarterAndStrength(@PathVariable("month_begin") String m_begin,@PathVariable("month_end") String m_end){
        return reportService.countByQuarterAndStrength(m_begin,m_end);
    }
    @RequestMapping("/strength/{year}")
    public  Map<String,List> countByYearAnStrength(@PathVariable("year") String year) {
        return  reportService.countByYearAndStrength(year);
    }
}